package com.wac.user.client;

import com.alibaba.fastjson.JSONObject;
import com.wac.common.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author wuancheng
 * @date 2024/8/26 14:41
 * @description url为固定第三方地址，没有负载均衡的能力，fallback为异常处理的返回
 */
@FeignClient(url = "https://www.baidu.com", contextId = "thirdClient", fallback = FeignConfiguration.class)
public interface ThirdClient {
    /**
     * 调用order服务的getOrder方法
     * value为ip后的url路径，实际完整的请求路径为ip地址+url路径
     *
     * @param param
     * @return
     */
    @PostMapping(value = "/getOrder", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    JSONObject getOrder(JSONObject param);
}
